from it.unimi.dsi.webgraph import *
from java.lang import *
import os
import jarray

STOP = 10
basedir = r'C:\jylab\examples\webmatrix'
relbasename = r'uk'
basename = os.path.join(basedir, relbasename)

graph = BVGraph.loadOffline(String(basename))
it = graph.nodeIterator(0)
for i in range(STOP):
    it.nextInt()
    outdegree = it.outdegree()
    successors = jarray.zeros(outdegree, 'i')
    successorArray = it.successorArray()
    for j in range(outdegree):
        successors[j] = successorArray[j]
    print successors
  
